#include<iostream>
//#include<string>
#include<cstdio>
#include<cstring>
//#include<cmath>
//#include<algorithm>
using namespace std;
int sa=0,sb=1;

void sum(int a,int b)
{
	int u=sa,v=sb;
	sb=b*v;
	sa=a*v+b*u;
}

void f()
{
	int i=1;
	while(i<=sa)
	{
		if ((sa%i==0)&&(sb%i==0))
		{
			sa=sa/i;
			sb=sb/i;
			i=1;
		}
		i++;
	}
}

int main()
{
	int n;
	int a,b;
	scanf("%d",&n);
	for (int i=0; i<n; i++)
	{
		scanf("%d/%d",&a,&b);
		sum(a,b);
		f();
	}
	if (sb==1) printf("%d",sa);
	else printf("%d/%d",sa,sb);
}